﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Expect.Core
{
    /// <summary>
    /// Summary of the specification execution
    /// </summary>
    public class ExecutionSummary
    {
        private DateTime _executionTime = DateTime.Now;
        /// <summary>
        /// The date and time of the start
        /// </summary>
        public DateTime ExecutionTime
        {
            get { return _executionTime; }
        }

        private DateTime _executionEndTime = DateTime.Now;
        /// <summary>
        /// The date and time of the start
        /// </summary>
        public DateTime ExecutionEnd
        {
            get { return _executionEndTime; }
            set { _executionEndTime = value;}
        }

        /// <summary>
        /// The duration of the execution
        /// </summary>
        public TimeSpan Duration
        {
            get
            {
                return (ExecutionEnd - ExecutionTime);
            }
        }

        private int _successful;
        /// <summary>
        /// The number of successful specifications
        /// </summary>
        public int Successful
        {
            get { return _successful; }
        }

        private int _failed;
        /// <summary>
        /// The number of failed specifications
        /// </summary>
        public int Failed
        {
            get { return _failed; }
        }

        //private int _inconclusive;
        ///// <summary>
        ///// The number of inconclusive specifications
        ///// </summary>
        //public int Inconclusive
        //{
        //    get { return _inconclusive; }
        //}

        internal void IncreaseSuccessful()
        {
            _successful++;
        }

        internal void IncreaseFailed()
        {
            _failed++;
        }

        //internal void IncreaseInconclusive()
        //{
        //    _inconclusive++;
        //}

        private IList<SpecificationDefinition> _runnedSpecs = new List<SpecificationDefinition>();
        /// <summary>
        /// The list of runned specifications
        /// </summary>
        public IList<SpecificationDefinition> RunnedSpecs
        {
            get { return _runnedSpecs; }
            set { _runnedSpecs = value; }
        }        
    }
}
